package cre.tomcat7.ch06.core;

import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;

/**
 * @Author penglai
 * @Date 2017/1/27.
 */
public class SimpleContextLifecycleListener implements LifecycleListener {

    public void lifecycleEvent(LifecycleEvent event) {
        System.out.println("SimpleContextLifecycleListener's event: " + event.getType());
        if (event.getType().equals(Lifecycle.START_EVENT)) {
            System.out.println("starting simple context.");
        }
        if (event.getType().equals(Lifecycle.STOP_EVENT)) {
            System.out.println("stopping simple context.");
        }
    }
}
